#!/bin/bash -x

grep -n -i //gabo /home/gabo/o9x/trunk/src/*

svn checkout http://open9x.googlecode.com/svn/ ~/o9x -r550

cd ~/o9x/trunk/src

sed -e s/'delta = (MAX_ACT \/\ 100) \/\ fadeTime;'/'delta = (MAX_ACT \/\ 50) \/\ fadeTime; \/\/\gabo'/ open9x.cpp > open9x.cpp_new
mv open9x.cpp_new open9x.cpp

make clean
#NAVIGATION nema vplyv na velkost EEPROM/Flash
make HELI=NO AUDIO=YES HAPTIC=YES EXT=FRSKY EEPROM_PROGRESS_BAR=YES #PPM_LIMITS_UNIT=US DISPLAY_USER_DATA=YES NAVIGATION=NO
cp open9x.hex open9xFrSky.hex
make HELI=YES AUDIO=YES HAPTIC=YES EEPROM_PROGRESS_BAR=YES #PPM_LIMITS_UNIT=US NAVIGATION=NO
make simu HELI=YES AUDIO=YES HAPTIC=YES EXT=FRSKY EEPROM_PROGRESS_BAR=YES PPM_CENTER_ADJUSTABLE=YES PPM_LIMITS_UNIT=US NAVIGATION=NO
cd



if ~/o9x/trunk/src/simu; then 
	exit 0
else

read -n1 -p "Exit? (y/n) "
echo
[[ $REPLY = [yY] ]] && exit 1 || { echo "You didn't answer yes."; exit 1; }

fi
